package selfLearn.theList.toWayList;

/**
 * 描述:
 *
 * @Package: selfLearn.theList.toList
 * @ClassName: TwoLinkListTest
 * @Author: 陈威
 * @CreateTime: 2022/1/27 14:44
 * @Description:
 */
public class TwoLinkListTest {

    public static void main(String[] args) {
        TwoLinkList<String> list = new TwoLinkList<>();
        list.insert("1");
        list.insert("2");
        list.insert("3");
        list.insert("4");
        System.out.println(list);
        System.out.println(list.get(2));
        for (String s : list) {
            System.out.print(s+",");
        }
        System.out.println();
        list.insert(2,"8");
        list.remove(3);
        for (String s : list) {
            System.out.print(s+",");
        }
        System.out.println();
        System.out.println(list.get(2));
        System.out.println(list.length());


        System.out.println(list.getFirst());
        System.out.println(list.getLast());
        list.clearList();
        for (String s : list) {
            System.out.print(s+",");
        }
        System.out.println();

        System.out.println(list.getFirst());
        System.out.println(list.getLast());
    }
}
